package com.zjw.nanyinge.feign;

import com.zjw.nanyinge.feign.config.WeChatFileFeignConfig;
import com.zjw.nanyinge.vo.resp.FileUploadRespVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "wechat-file-api-service", url = "${weChat.url}",configuration = WeChatFileFeignConfig.class)
public interface WeChatFileApi {

    @PostMapping(value = "/cgi-bin/media/upload", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    FileUploadRespVO fileUpload(@RequestParam("access_token") String accessToken, @RequestParam("type") String type, @RequestPart("media") MultipartFile media);

}
